home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr25 / newzips.zip / NEWZIPS.CMD < prev    next >
OS/2 REXX Batch file  |  1993-06-21  |  2KB  |  70 lines

  1. /*   */
  2. /* trace ?r */
  3. /******************************************************************
  4. Change the next two lines to set default directories
  5. *******************************************************************/
  6. defaultdown = 'e:\download'
  7. defaultdest = 'f:\tools'
  8. /******************************************************************/
  9. arg downdirect destdirect  .
  10. if downdirect = '' then downdirect = defaultdown
  11. if destdirect = '' then destdirect = defaultdest
  12. if downdirect = '.' then downdirect = directory()
  13. downdrive = left(downdirect,1)
  14. destdrive = left(destdirect,1)
  15. if (right(downdirect,1) <> '\') then downdirect = downdirect'\'
  16. if (right(destdirect,1) <> '\') then destdirect = destdirect'\'
  17. Call RxFuncAdd 'SysSetObjectData', 'RexxUtil', 'SysSetObjectData'
  18. /* pull anything already in the queue */
  19. numb = queued()
  20. do i = 1 to numb 
  21. pull .
  22. end
  23.  
  24. 'dir 'downdirect||'*.* | rxqueue'   /* get list of  files */
  25. /* 'dir 'downdirect||'*.lzh | rxqueue'   */
  26. i=0
  27. numb = queued()
  28. do j = 1 to numb
  29. parse upper pull name type .
  30. select
  31.   when type = 'ZIP'
  32.      then do
  33.      destdrive':'     /* switch to destination drive */
  34.      newdirect = destdirect||name
  35.      'md 'newdirect
  36.      'cd ' newdirect
  37. /**************************************************************
  38. Change the next line to use the right unzip routine
  39. ***************************************************************/
  40.      'unzip -o ' downdirect||name
  41.      if rc = 0 then 
  42.         do
  43.         'erase 'downdirect||name||'.piz'
  44.         'rename 'downdirect||name||'.zip' name||'.piz'
  45.         Call SysSetObjectData newdirect, 'OPEN=DEFAULT' 
  46.         end
  47.      end   
  48. when type = 'LZH'
  49.      then do
  50.      destdrive':'     /* switch to destination drive */
  51.      newdirect = destdirect||name
  52.      'md 'newdirect
  53.      'cd ' newdirect
  54. /*************************************************************
  55. Change the next line to use the right LHZ unarchiver
  56. *************************************************************/
  57.      'LH32 X /o' downdirect||name
  58.      if rc = 0 then 
  59.         do
  60.         'erase 'downdirect||name||'.hzl'
  61.         'rename 'downdirect||name||'.lzh' name||'.hzl'
  62.         Call SysSetObjectData newdirect, 'OPEN=DEFAULT' 
  63.         end
  64.      end   
  65.   otherwise 
  66.  
  67. end
  68.  end
  69. Call SysSetObjectData LEFT(DOWNDIRECT,LENGTH(downdirect)-1) , 'OPEN=DEFAULT'
  70.